package cn.jw.starter.web.common;

import org.slf4j.helpers.MessageFormatter;

/**
 * <p>
 * 业务通用异常
 * </p>
 *
 * @author 王广帅
 * @since 2024/4/9 8:56
 **/
public class JwServiceException extends RuntimeException {
    private JwErrorBase errorBase;

    public JwServiceException(JwErrorBase errorBase, Object... params) {
        super(MessageFormatter.arrayFormat(errorBase.getErrorMsg(), params).getMessage());
        this.errorBase = errorBase;
    }

    public JwErrorBase getErrorBase() {
        return errorBase;
    }
}
